#include "HiranipraCommon.h"

#include "Net/NetServer.h"

#ifndef _SERVER_APP_H_
#define _SERVER_APP_H_

namespace Hiranipra {
	namespace Server {
		using namespace Hiranipra::HCM;
		using namespace Hiranipra::Net;
		using namespace Hiranipra::Platform;
		using namespace Hiranipra::Platform::IO;

		class ServerApp
		{
		public:
			ServerApp();
			~ServerApp();

			bool RegisterAssembly( wstring path );
			int Start( wstring appPath, vector<wstring> args );

		public:
			FORCE_INLINE IApplication*		GetApplication() const { return _app; }
			FORCE_INLINE IFileSystem*		GetFileSystem() const { return _fs; }
			FORCE_INLINE NetServer*			GetNetServer() const { return _netServer; }

		private:
			class NetworkRunner; friend class NetworkRunner;

			ComponentRegistry	_hcmRegistry;
			IApplication*		_app;
			IFileSystem*		_fs;

			IOQueue*			_ioQueue;

			NetServer*			_netServer;
		};

	}
}

#endif // _SERVER_APP_H_
